package com.young4j.springdemo.controller;

import com.young4j.springdemo.entity.Student;
import com.young4j.springdemo.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description
 * @Author yf
 * @Date 2018/12/26 14:21
 **/
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private com.young4j.springdemo.service.TestStudentService studentService;

    @Autowired
    private IStudentService iStudentService;
    @RequestMapping("/list")
    public Object list() {
        List<Student> students = iStudentService.selectLists();
        for (Student student : students) {
            System.out.println(student.toString());
        }
        return studentService.listTest();
    }
}
